package day05;

import java.util.Arrays;
import java.util.Random;

public class ArraySort {
    public static void main(String[] args) {
        Random rand = new Random();
        int a = rand.nextInt(100);
        System.out.print("输出随机数为：");
        System.out.println(a);
        int[] arr = new int[10];
        for (int i=0;i<arr.length;++i) {
            arr[i] = (int) (Math.random() * 99);
        }
        Arrays.sort(arr);
        System.out.println(Arrays.toString(arr));
        //倒着输出数组中的元素，不过数组还是升序的，只是倒序输出
        for (int i = arr.length - 1; i >= 0; --i) {
            System.out.print(arr[i]+"\t");
        }

    }
}
